package com.iversonx.observer.example_1.service;

import org.springframework.stereotype.Service;

/**
 *
 **/
@Service
public class MinibusTargetService {
    /**
     * 模拟摇号
     */
    public String lottery(String uId) {
        boolean hitLottery = Math.abs(uId.hashCode()) % 2 == 0;
        String result;
        if(hitLottery) {
            result = "恭喜你，编码" + uId + "在本次摇号中签";
        } else {
            result = "很遗憾，编码" + uId + "在本次摇号未中签";
        }
        return result;
    }
}
